const fs = require('fs');
const path = require('path');

const vectorStorePath = path.join(__dirname, 'vector_store');
console.log('Vector store path:', vectorStorePath);

// 检查目录是否存在
if (fs.existsSync(vectorStorePath)) {
    console.log('✓ Vector store directory exists');
    
    // 列出目录中的文件
    const files = fs.readdirSync(vectorStorePath);
    console.log('Files in vector store directory:', files);
    
    // 检查每个文件
    files.forEach(file => {
        const filePath = path.join(vectorStorePath, file);
        const stat = fs.statSync(filePath);
        console.log(`  ${file}: ${stat.size} bytes`);
    });
} else {
    console.log('✗ Vector store directory does not exist');
}

// 检查特定文件是否存在
const indexFile = path.join(vectorStorePath, 'hnswlib.index');
console.log('Index file path:', indexFile);
console.log('Index file exists:', fs.existsSync(indexFile));